/*****************************************************************************
 *   Copyright 2011 ZHUANG Yuan              	                             *
 *   SudokuITS as Final Year Project for BScCS, City University of Hong Kong *
 *                                      									 *
 *   Licensed under the Apache License, Version 2.0 (the "License");         *
 *   you may not use this file except in compliance with the License.        *
 *   You may obtain a copy of the License at                                 *
 *                                                                           *
 *   http://www.apache.org/licenses/LICENSE-2.0                              *
 *                                                                           *
 *   Unless required by applicable law or agreed to in writing, software     *
 *   distributed under the License is distributed on an "AS IS" BASIS,       *
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.*
 *   See the License for the specific language governing permissions and     *
 *   limitations under the License.                                          *
 *****************************************************************************/

package android.sudoku.its.student;

import android.sudoku.its.util.GameVariables;

public class StudentUtil {
	/**
	 * Determine student level by Sudoku experience
	 * 
	 * if (sudokuExperience == 0)
	 * 		naive level
	 * else if (sudokuExperience < 10)
	 * 		beginner level
	 * else if (sudokuExperience < 30)
	 * 		intermediate level
	 * else
	 *  	advanced level
	 *  
	 * @param sudokuExperience		The number of Sudoku the student has played before
	 * @return						A integer indicating student's level
	 */
	public int determineStudentLevel(int sudokuExperience) {
		int studentLevel = 0;
		
		if (sudokuExperience == 0)
			studentLevel = 0;	// naive level
		else if (sudokuExperience <= GameVariables.LEVEL_BEGINNER_THRESHOLD)
			studentLevel = 1; 	// beginner level
		else if (sudokuExperience <= GameVariables.LEVEL_INTERMEDIATE_THRESHOLD)
			studentLevel = 2; 	// intermediate level
		else
			studentLevel = 3;	// advanced level
		
		return studentLevel;
	}	
}
